var express = require("express");
var app = express();
var router = require("./router/router.js");
var session = require("express-session");

app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true
    })
)
app.set("view engine","ejs");       // 模板引擎

app.use(express.static("./public"))         // 静态文件
app.use("/avatar",express.static("./avatar"))         

app.get("/",router.showIndex);
app.get("/regist",router.showRegist);
app.post("/doregist",router.doregist);
app.get("/login",router.showLogin);
app.post("/dologin",router.doLogin);
app.get("/setavatar",router.showSetavatar);
app.post("/dosetavatar",router.doSetavatar);
app.get("/cut",router.showCut);
app.get("/docut",router.docut);
app.post("/post",router.dopost);
app.get("/Allshuoshuo",router.getAllshuoshuo);
app.get("/userinfo",router.getUserinfo);
app.get("/Allamount",router.getAllamount);
app.get("/user/:user",router.showUser);
app.get("/userlist",router.showUserlist);       

app.listen(3000);